// Copyright 2011 George Cook
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


#import "InjectiveObjectDescription.h"
#import "NSString+Additions.h"

@implementation InjectiveObjectDescription
@synthesize ID;
@synthesize type;
@synthesize isSingleton;
@synthesize propertyDescriptions;
@synthesize initParams, initSelectorName;
@synthesize key = _key;
@synthesize autoInitialize;

#pragma mark -
#pragma mark init and dealloc

- (void)dealloc
{
	[initSelectorName release], initSelectorName = nil;
	[initParams release], initParams = nil;
	[propertyDescriptions release], propertyDescriptions = nil;
	[type release], type = nil;
	[ID release], ID = nil;
	[_key release], _key = nil;
	[super dealloc];
}

+ (id) objectDescriptionWithType:(NSString *) type andID:(NSString *) ID
{
	return [[[InjectiveObjectDescription alloc] initWithType:type andID:ID] autorelease];
}

- (id)init
{
	if (self =[super init]) {
		_key = [[NSString uuid] retain];
	}
	return self;
}

- (id)initWithType:(NSString *) aType andID:(NSString *) anID
{
	if (self = [self init]) {
		ID = [anID retain];
		type = [aType retain];
	}
	return self;
}

#pragma mark description
- (NSString *)description
{
	return [[super description] stringByAppendingFormat:@"key: %@ \ntype: %@ ID: %@ \npropertyDescriptions: \n============\n%@ \ninitSelctorName %@ initselector params %@",
			self.key, self.type, self.ID, self.propertyDescriptions, self.initSelectorName, self.initParams];
}


@end
